/**
 * Request.java
 */
package fss.common.communication;

import java.io.Serializable;
import java.util.List;

import fss.util.rmi.RmiId;

/**
 * A request is the communication object between
 * <ol>
 *  <li>Registry and Service</li>
 *  <li>Service and Client</li>
 *  <li>Registry and Registry</li>
 * </ol>
 * <p>
 * It originates from one <b>source</b> and will go to a specified
 * <b>desintation</b>. Although a request has a source and destination,
 * the intended <b>recipient(s)</b> may not be the destination object.
 * 
 * @author thinh
 *
 */
public interface Request extends Serializable {
    /**
     * Get the source id.
     * @return the id.
     */
    public RmiId getSource();
    /**
     * Get the destination id.
     * <p>
     * This is usually where the source sends the message
     * to and is not necessarily the intended recipient(s).
     * @return the destination id.
     */
    public RmiId getDestination();
    /**
     * Get the recipient(s).
     * @return a list of recipient(s), or an empty list.
     */
    public List<RmiId> getRecipientList();
    /**
     * Add to the list of recipient(s).
     * @param recipient an id.
     */
    public void addRecipientList(RmiId recipient);
    /**
     * Add a message to the logs.
     * @param msg the log message.
     */
    public void addLog(String msg);
    /**
     * Add an error message.
     * @param err the error message.
     */
    public void addError(String err);
    /**
     * Get the logs.
     * @return the logs; or an empty log array.
     */
    public List<String> getLogs();
    /**
     * Get the error logs.
     * @return the error logs; or an empty log array.
     */
    public List<String> getErrors();
}
